#pragma once

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<time.h>
#include<string.h>
#include<stdbool.h>

#define NUM 10000000

typedef struct Stack
{
	int* arr;
	int top;
	int capacity;
}Stack;

typedef struct QueueNode
{
	int val;
	struct QueueNode* next;
}QNode;

typedef struct Queue
{
	QNode* head;
	QNode* tail;
}Queue;

Queue* QueueInit();
void QueuePush(Queue* Q, int x);
void QueuePop(Queue* Q);
int QueueRead(Queue* Q);
void QueueDestroy(Queue* Q);
bool QueueEmpty(Queue* Q);

Stack* StackInit();
void StackPush(Stack* ST, int x);
void StackPop(Stack* ST);
int StackRead(Stack* ST);
void StackDestroy(Stack* ST);
bool StackEmpty(Stack* ST);


void MyInSort(int arr[], int size);
void InsertSort(int arr[], int size);
void SortPrint(int arr[], int size);
void ShellSort(int arr[], int size);
void AdjustDown(int arr[], int top, int father);
void swap(int* x, int* y);
void HeapSort(int arr[], int size);
void QuickSort(int* arr, int begain, int end);
void QuickSortNonr_Stack(int* arr, int size);
void QuickSortNonr_Queue(int* arr, int size);
void BubbleSort(int arr[], int n);
void SelectSort(int* arr, int n);
void MergeSort(int* arr, int size);
void MergeSortNonr(int* arr, int size);
void CountSort(int* arr, int size);


extern int count;